#include <iostream>
#include <sstream>
#include <cstdlib>

#include "bills.h"
#include "book.h"
#include "dollars.h"
#include "dictionary.h"

using namespace std;

int main() {
    srand(time(NULL));

    Bills bills, bills2;
    cout << "Enter your bills in format: denominal/count: ";
    cin >> bills;
    cout << "You enter " << bills << ". Sum of bills is " << bills.summa() << ".\n";
    cout << "Now please enter another bills: ";
    cin >> bills2;
    bills = bills2;
    cout << "Your another bills is " << bills << ". Sum of bills is " << bills.summa() << ".\n";

    Book book, book2;
    cout << "Enter your book in format:\n===\nName\nAuthor\nPublish Year\n===\n> \n";
    cin >> book;
    cout << "You enter:\n" << book << "\n";
    cout << "Now please enter another book:\n";
    cin >> book2;
    book = book2;
    cout << "Your another book is:\n" << book << "\n";

    Dollars dol(rand(), bills);
    cout << "Your bills: " << dol << " with circulation id: " << dol.getID() << "\n";

    Dictionary dict(book);
    string word_name, word_desc;
    cout << "Enter word and description in next line: ";
    getline(cin, word_name);
    getline(cin, word_desc);
    dict.setWord(word_name, word_desc);
    cout << dict << word_name << ": " << dict.getWordDescription(word_name) << "\n";
}
